package com.woniu.controller;

import com.woniu.dto.RealTimeMonitoring.ChargerInfoRequestDTO;
import com.woniu.entity.Charger;
import com.woniu.service.ChargerService;
import com.woniu.util.PageData;
import com.woniu.util.ResponseData;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/charger")
@AllArgsConstructor
public class ChargerController {

    private ChargerService chargerService;
    @PostMapping("/chargerList")
    public ResponseData<?> getchargerListByStationId(@RequestBody PageData<ChargerInfoRequestDTO> pageParam) {
        return chargerService.getchargerListByStationId(pageParam);
    }
    @GetMapping("/chargerList")
    public ResponseData<?> getchargerList() {
        List<Charger> list = chargerService.list();
        return ResponseData.ok(list);
    }
    @PostMapping("/chargerListWx")
    public ResponseData<?> getchargerListByStationIdWx(@RequestBody ChargerInfoRequestDTO requestDTO) {
        return chargerService.getchargerListByStationIdWx(requestDTO);
    }
    @PostMapping("/getFee")
    public ResponseData<?> getFee(@RequestBody ChargerInfoRequestDTO requestDTO) {
        return chargerService.getFee(requestDTO);
    }
}
